package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.RoleDao;
import com.itheima.pojo.Role;
import com.itheima.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.Set;

/**
 * @author hql
 * @date 2019-12-11 19:16
 */
@Service(interfaceClass = RoleService.class)
@Transactional
public class RoleServiceImpl  implements RoleService {
    @Autowired
    private RoleDao roleDao;

    /**
     * 根据UserId查询所有的角色对象
     * @param id
     * @return
     */
    @Override
    public Set<Role> findByUserId(Integer id) {
        Set<Role> roleSet =  roleDao.findByUserId(id);
        return roleSet;
    }
}
